package snippet;

import metier.Algo;

import java.util.Observable;
import java.util.Observer;
import java.util.concurrent.*;

/**
 * Created with IntelliJ IDEA.
 * User: keita
 * Date: 15/06/13
 * Time: 15:02
 */
public class tickerHandler extends ThreadPoolExecutor {


    public tickerHandler() {
        super(Runtime.getRuntime().availableProcessors(), 4, 10, TimeUnit.SECONDS,new ArrayBlockingQueue<Runnable>(10, true),new RejectHandler());
        System.out.println("tickerHandler nb Procs: "+Runtime.getRuntime().availableProcessors());
    }

    public void send(Object o) {
        this.execute(new Algo(o));

    }
}
